<?php
class Web_View_Helper_CommerceTime
	extends Zend_View_Helper_Abstract 
{
	public function commerceTime( $negocio ) 
	{
    
	    if (strpos($negocio->tiempoEntrega, "-")){
	        list($a, $b) = explode("-",$negocio->tiempoEntrega);
	        
	        $a = (int) $a;
	        
	        if( $a <= 150 ){
	        
	            $text = "{$this->view->translate('between')} {$a} {$this->view->translate('and')} {$b} {$this->view->translate('minutes')}</p>";
	            
	        }else{
	        
	            $a = $a / 60; 
	            $b = $b / 60; 
	            
	            $text = "{$this->view->translate('between')} {$a} {$this->view->translate('and')} {$b} {$this->view->translate('hours')}</p>";
	            
	        }
	        
	    } else {
	        $a = $negocio->tiempoEntrega;
	        $b = null;
	        
	        
	        
	        if( $a <= 150 ){
	        
	            $text = "{$a} {$this->view->translate('minutes')}</p>";
	            
	        }else{
	        
	            $a = $a / 60; 
	            
	            $text = "{$a} {$this->view->translate('hours')} </p>";
	            
	        }
	        
	        
	    }
		
		return "<p class='time'>{$text}</p>";
	}

}